/**
 * @License: (C) Copyright 2013-2022
 * @Contact: abcque@outlook.com
 * @IDE: IntelliJ IDEA
 * @Encoding: utf-8
 * @Project: st2214 2215
 * @Package: PACKAGE_NAME
 * @File: DoWhile2.java
 * @Time: 2022/12/5 19:51
 * @Author: abcque
 * @Description: 计算 1-100 所有的 7 的倍数之和
 * @Modifier:
 * @ModifyDate:
 * @ModifyRemark:
 */
public class DoWhile2 {
    public static void main(String[] args) {
        // step1、使用 do-while 循环变量 1-100，循环变量为 i
        int i = 1;
        // step2、计算 7 的倍数之和
        int sum = 0;
        int count = 0;
        do {
            if (i % 7 == 0) {
                sum += i;
                ++count;
            }
            ++i;
        } while (i <= 100);

        System.out.println("sum = " + sum);
        System.out.println("count = " + count);
    }
}
